home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.7 KB | 41 lines | [TEXT/GEOL] |
- Item 2734525 8-Feb-88 11:43
-
- From: ROSENSTEIN1 Rosenstein, Larry
-
- To: D1002 PEMD Ed Group, Dev, E Rosenberg
-
- cc: MACAPP$ MacApp Interest List
-
- Sub: re Cloning
-
- The short answer is that cloning a TView doesn't work.
-
- TObject.Clone simply duplicates the storage associated with an object. If you
- have a complex object with references to other objects as fields, then the
- object might have to override Clone and deal with those references. In
- general, we did not do this for the MacApp classes, because the internal
- structure of the objects is so complex.
-
- In the case of TView, there is a relationship between the view object and the
- frame that displays it. The frame object contains a reference to the view, and
- is the object responsible for drawing the view. Simply cloning the view won't
- clone the frame, so there is no call to TView.Draw.
-
- Even if you create a separate frame and tell the view clone to display in that
- frame, there are other things that won't be correct. For example, the document
- object contains a list of all the view.
-
- Clone is not as much of a time saver as you might think. For example, the
- number of methods implemented in a class has no impact on the time it takes to
- create an object of that class. All the methods as a group are referenced with
- one pointer. The only time you save is in the initialization method, which is
- not really significant.
-
- With some work, I suppose we could have made TView.Clone work. However, we did
- not expect people to clone views as a substitute for creating them in the usual
- way (New(...); IView(...)).
-
- Larry
-
-
-